#include "connectionpool.hpp"

int main()
{

    clock_t begin = clock();
    Connectionpool* cp=Connectionpool::getConnectionpool();
    for (int i = 0; i < 1000; i++)
    {

        /*
        Mysql mysql;
        char sql[1024] = {0};
        sprintf(sql, "insert into stu(name,age,sex) values('%s','%d','%s')", "wang wu", 20, "male");
        mysql.connect(server.c_str(), 3306, usr.c_str(), password.c_str(), dbname.c_str());
        mysql.update(sql);
        */
       shared_ptr<Mysql> sp=cp->getmysql();
        char sql[1024] = {0};
        sprintf(sql, "insert into stu(name,age,sex) values('%s','%d','%s')", "wang wu", 20, "male");
        sp->update(sql);
    }
    clock_t end=clock();
    cout<<end-clock()<<"ms"<<endl;
    return 0;
}